<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>寄存编辑</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header">
					{if !$info['id']}<i class="fa fa-plus"></i> 添加寄存{else}<i class="fa fa-pencil"></i> 编辑寄存{/if}
					{if input('param.isopen')==1}
					<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>
					{/if}
				</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w6">
						<input type="hidden" name="info[id]" value="{$info.id}"/>
						<div class="layui-form-item">
							<label class="layui-form-label">{:t('会员')}ID：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[mid]"  class="layui-input" value="{$info.mid}">
							</div>
							<div class="layui-form-mid layui-word-aux"><a href="javascript:vodi(0)" onclick="openmax('{:url('member/index')}/isopen/1')">查找{:t('会员')}ID</a></div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redstar">*</span>寄存名称：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[name]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.name}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redstar">*</span>寄存数量：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[num]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.num}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="redstar">*</span>存酒人：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[linkman]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.linkman}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">手机号：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[tel]"  class="layui-input" value="{$info.tel}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">存酒备注：</label>
							<div class="layui-input-inline" style="width:200px">
								<input type="text" name="info[message]" lay-verType="tips" class="layui-input" value="{$info.message}">
							</div>
						</div>
						
						<div class="layui-form-item">
							<label class="layui-form-label">存酒拍照：</label>
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="pic" upload-preview="picPreview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：640×640像素</div>
							<div id="picPreview" style="float:left;padding-top:10px;padding-left:130px;clear: both;">
								<div class="layui-imgbox imgbox-required">
									<div class="layui-imgbox-img"><img src="{$info['pic']}"/></div>
									<input type="text" name="info[pic]" id="pic" class="layui-input" value="{$info['pic']}">
								</div>
							</div>
						</div>

						<div class="layui-form-item">
							<div class="layui-form-label"></div>
							<div class="layui-input-block">
								<button class="layui-btn layui-btn-danger" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
	{include file="public/js"/}
	<script>
	//var ueditor = UE.getEditor('content');
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		//field['info[content]'] = ueditor.getContent();
		//console.log(field);return;
		var index = layer.load();
		$.post("{:url('edit')}",field,function(data){
			layer.close(index);
			dialog(data.msg,data.status);
			if(data.status == 1){
				{if input('param.isopen')==1}
				setTimeout(function(){
					parent.layer.close(parent.layer.getFrameIndex(window.name));
					parent.tableIns.reload()
				},1000);
				{else}
				setTimeout(function(){
					location.href="{:url('index')}"
				},1000);
				{/if}
			}
		})
	})
  </script>
	{include file="public/copyright"/}
</body>
</html>